package com.pkk.cloud.support.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pkk.cloud.support.admin.dto.req.urls.OauthResourceUrlCheckReqDto;
import com.pkk.cloud.support.admin.dto.req.urls.OauthUrlsAddReqDto;
import com.pkk.cloud.support.admin.dto.req.urls.ResourceUrlBindReqData;
import com.pkk.cloud.support.admin.dto.resp.urls.OauthResourceUrlsCheckRespDto;
import com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAddRespDto;
import com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAllRespDto;
import com.pkk.cloud.support.admin.entity.resource.PenguinSysUrl;
import java.util.List;
import java.util.Set;

/**
 * @author peikunkun<br>
 * @version V1.0<br>
 * @Title: 接口的业务接口<br>
 * @Description: <><br>
 * @date 2020/4/2 0002 下午 3:16<br>
 * @URL:[]
 */
public interface PenguinSysUrlService extends IService<PenguinSysUrl> {


  /**
   * @Description: 保存接口信息
   * @Param: record
   * @return: int
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 5:09
   */
  boolean insertPenguinSysUrl(PenguinSysUrl record);

  PenguinSysUrl selectByPrimaryKey(Long id);

  int updateByPrimaryKeySelective(PenguinSysUrl record);

  /**
   * @Description: 根据用户id查询URL的资源
   * @Param: parseLong
   * @return: java.util.List<java.lang.String>
   * @Author: peikunkun
   * @Date: 2020/3/18 下午9:10
   */
  List<String> findUserUrlResourceByUserId(long parseLong);

  /**
   * @Description: 获取资源信息依据用户id
   * @Param: userId
   * @return: java.util.List<com.pkk.cloud.support.admin.entity.resource.PenguinSysUrlResource>
   * @Author: peikunkun
   * @Date: 2020/3/18 下午9:13
   */
  List<PenguinSysUrl> findPenguinUserUrlResourceByUserId(long userId);

  /**
   * @Description: 保存接口
   * @Param: urls
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 下午 3:15
   */
  OauthUrlsAddRespDto saveSysUrl(OauthUrlsAddReqDto reqDto, String userId);

  /**
   * @Description: 删除系统接口依据id
   * @Param: id
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 下午 3:40
   */
  boolean delSysUrlById(Long[] id);

  /**
   * @Description: 更新接口地址依据id
   * @Param: url
   * @return: boolean
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 下午 3:48
   */
  boolean updateSysUrlById(PenguinSysUrl url);

  /**
   * @Description: 获取系统全部接口
   * @return: java.util.List<com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAllReqDto>
   * @Author: peikunkun
   * @Date: 2020/4/2 0002 下午 3:54
   */
  List<OauthUrlsAllRespDto> findSysUrlList();

  /**
   * @Description: 根据按钮id资源查询所拥有的接口信息
   * @Param: body
   * @return: java.util.List<com.pkk.cloud.support.admin.dto.resp.urls.OauthUrlsAllReqDto>
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 3:10
   */
  List<OauthUrlsAllRespDto> findUrlsByResourceId(Long resourceId);

  /**
   * @Description: 获取资源接口列表
   * @Param: request
   * @Author: peikunkun
   * @Date: 2020/4/22 0022 上午 10:24
   */
  List<OauthResourceUrlsCheckRespDto> getResourceBindUrlList(OauthResourceUrlCheckReqDto body);

  /**
   * @Description: 获取已绑定接口信息依据按钮和菜单信息
   * @Param: buttonId
   * @Param resourceId
   * @Author: peikunkun
   * @Date: 2020/4/22 0022 上午 10:34
   */
  Set<Long> getExistsUrlIdByResourceInfo(Long buttonId, Long resourceId);

  /**
   * @Description: 获取客户端下面的所有接口
   * @Param: ownClientId
   * @return: java.util.Set<java.lang.String>
   * @Author: peikunkun
   * @Date: 2020/4/22 0022 上午 11:50
   */
  Set<String> findClientUrlsByClientId(Long ownClientId);

  /**
   * @Description: 绑定资源与接口信息
   * @Param: body
   * @return: java.lang.Boolean
   * @Author: peikunkun
   * @Date: 2020/4/22 0022 下午 3:09
   */
  boolean bindResourceUrl(ResourceUrlBindReqData body);
}
